const express=require("express")
const login=require("./module/login")
const verify=require("./module/verify")
const render=require("./module/render")
const register=require("./module/register")
const cartadd=require("./module/cartadd")
const cartupdata=require("./module/cartupdata")
const cartdel=require("./module/cartdel")

const app=express()
app.use(express.static("./www"))
app.use(express.urlencoded())

app.get("/login",login)
app.get("/verify",verify)
app.get("/render",render)
app.post("/register",register)
app.post("/cartadd",cartadd)
app.post("/cartupdata",cartupdata)
app.post("/cartdel",cartdel)

app.listen(3000,()=>{
  console.log("服务器开启成功");
})
// app.all("*", (req,res,next)=>{
//   res.header('Access-Control-Allow-Origin', '*')
//   res.header('Access-Control-Allow-Methods', 'get,post')
//   res.header('Access-Control-Allow-Headers', 'Content-Type')
//   next();
// })